﻿<%@ Page language="c#" Codebehind="Index.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.Mail.MailList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<meta name="author" content="Herry" />
<meta name="Copyright" content="Copyright (c) 2009 himm.cn" />
<title>Index</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="/css/other.css" media="screen" />
<style type="text/css">
table {
	width:100%;
	border:none;
}
table th {
	background:#ccccff;
}
table th, table td {
	padding:3px;
}
table td span a, table td span a:visited {
	color:#fff;
}
.active1 {
	background:#1a499d;
}
.active2 {
	background:#337fb2;
	color:#fff;
	font-weight:bold;
}
.tabnavhead {
	text-align:right;
	position:relative;
}
.tnc {
	float:left;
	width:90px;
	height:30px;
	margin:0 0 0 5px;
	position:relative;
	bottom:0px;
}
.tnc a {
	width:90px;
	height:26px;
	display:block;
	padding:4px 0 0;
	text-align:center;
	line-height:26px;
	color:#fff;
}
.tnc a:visited {
	color:#fff;
}
.tnc a:hover {
	color:#ff0;
}
</style>
<script language="javascript">
	
var ball1 = new Image();
var ball2 = new Image();
ball1.src = 'images/ball1.gif';
ball2.src = 'images/ball2.gif';

var active = new Image();
var nonactive = new Image();
active.src = '../../../images/maillistbutton2.gif';
nonactive.src = '../../../images/maillistbutton1.gif';

function onMouseOver(img)
{
	document.images[img].src = ball2.src;
}

function onMouseOut(img)
{
	document.images[img].src = ball1.src;
}

function onOverBar(bar)
{
	if (bar != null) {
		bar.style.backgroundImage = "url("+active.src+")";
		
	}
}

function onOutBar(bar)
{
	if (bar != null) {
		bar.style.backgroundImage = "url("+nonactive.src+")";
	}
}

function selectAll(){
	var len=document.MailList.elements.length;
	var i;
    for (i=0;i<len;i++){
	if (document.MailList.elements[i].type=="checkbox"){
        document.MailList.elements[i].checked=true;								
				 }
			}
		}

function unSelectAll(){
      var len=document.MailList.elements.length;
      var i;
      for (i=0;i<len;i++){
           if (document.MailList.elements[i].type=="checkbox"){
              document.MailList.elements[i].checked=false; 
           }   
    	 } 
    }		

</script>
</head>

<body>
<div class="m">
<form id="MailList" method="post" runat="server">
  <p class="path"><span class="right"><asp:label id="lblMsg" runat="server"></asp:label><asp:button id="btnClear" runat="server" Visible="False" Text="清 空"></asp:button><asp:button id="btnDelete" runat="server" Text="删 除" CssClass="redButtonCss"></asp:button><INPUT class="redButtonCss" onclick="selectAll()" type="button" value="全 选"><INPUT class="redButtonCss" onclick="unSelectAll()" type="button" value="取 消"><asp:dropdownlist id="listFolderType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="FolderListChange"></asp:dropdownlist></span><a href="/SubModule/UnitiveDocument/">我的桌面</a> >> 我的邮件</p>
  <div class="con">
  <div class="tabnav">
        <p class="tabnavhead"> <span id="bar1" class="<% Response.Write(Session["FolderType"].ToString()=="1"?"active2":"active1");%> tnc">
          <a href="Index.aspx?FolderType=1">收件箱</a>
          </span> <span id="bar2" class="<% Response.Write(Session["FolderType"].ToString()=="2"?"active2":"active1");%> tnc">
          <a href="Index.aspx?FolderType=2">发件箱</a>
          </span> <span id="bar3" class="<% Response.Write(Session["FolderType"].ToString()=="3"?"active2":"active1");%> tnc">
          <a href="Index.aspx?FolderType=3">废件箱</a>
          </span> <span id="bar4" class="active1 tnc">
          <a href="Compose.aspx?ClassID=0">撰写新邮件</a>
          </span> <span id="bar5" class="<% Response.Write(Session["FolderType"].ToString()=="4"?"active2":"active1");%> tnc">
          <a href="Index.aspx?FolderType=4">外部邮件</a>
          </span><asp:DropDownList id="listExtMail" runat="server" Visible="False"></asp:DropDownList><asp:Button id="btnBeginReceive" runat="server" CssClass="redButtonCss" Text="开始接收" Visible="False"></asp:Button><asp:Button id="btnExtPopSetup" runat="server" CssClass="redButtonCss" Text="外部邮箱设置" Visible="False"></asp:Button>
        </p>
      </div>
        <div>
		<asp:datagrid id="dgMailList" runat="server" Width="100%" OnItemDataBound="DataGrid_ItemDataBinding" OnSortCommand="DataGrid_Sort" AllowSorting="True" CellPadding="3" BackColor="White" BorderWidth="1px" BorderStyle="None" BorderColor="#337FB2" AutoGenerateColumns="False" AllowPaging="True" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Right" OnPageIndexChanged="DataGrid_PageChanged" DataKeyField="MailID" PageSize="15">
							<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
							<AlternatingItemStyle BackColor="#E8F4FF"></AlternatingItemStyle>
							<ItemStyle HorizontalAlign="Center" ForeColor="Black" VerticalAlign="Middle" BackColor="White"></ItemStyle>
							<HeaderStyle HorizontalAlign="Center" Height="10px" ForeColor="White" VerticalAlign="Top" BackColor="#337FB2"></HeaderStyle>
							<FooterStyle Font-Size="XX-Small" HorizontalAlign="Center" Height="10px" ForeColor="Black" VerticalAlign="Bottom" BackColor="#93BEE2"></FooterStyle>
							<Columns>
								<asp:TemplateColumn HeaderText="选择">
									<HeaderStyle HorizontalAlign="Center" Width="40px"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center" Height="20px" Width="60px"></ItemStyle>
									<ItemTemplate>
										<asp:CheckBox id="grpMailID" Checked="False" Runat="server"></asp:CheckBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="邮件主题">
									<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate><a href='ReadMail.aspx?MailId=<%# DataBinder.Eval(Container.DataItem,"MailID") %>&CurrentPageIndex=<%=CurrentPageIndex%>&FolderType=<%=Session["FolderType"].ToString()%>'><%# (DataBinder.Eval(Container.DataItem,"MailSubject").ToString().Length>20)?DataBinder.Eval(Container.DataItem,"MailSubject").ToString().Substring(0,20)+"...":DataBinder.Eval(Container.DataItem,"MailSubject").ToString() %></a>
									<%# DataBinder.Eval(Container.DataItem,"attnumber").ToString()=="0"?"":"<img src='../../../DataImages/attach.gif' border='0'>" %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:BoundColumn DataField="MailSender" SortExpression="MailSender" HeaderText="发送者">
									<HeaderStyle Width="100px"></HeaderStyle>
									<ItemStyle  ></ItemStyle>
								</asp:BoundColumn>
								<asp:TemplateColumn HeaderText="接收者">
									<HeaderStyle Width="100px"></HeaderStyle>
									<ItemTemplate>
										<asp:Label runat="server" Text='<%# GetRealNameStr(DataBinder.Eval(Container, "DataItem.MailReceiver").ToString()) %>'>
										</asp:Label>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="所有接收者">
									<HeaderStyle Width="100px"></HeaderStyle>
									<ItemTemplate>
										<asp:Label runat="server" Text='<%# GetRealNameStr(DataBinder.Eval(Container, "DataItem.MailReceiverStr").ToString()) %>'>
										</asp:Label>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="是否已读">
									<HeaderStyle Width="80px"></HeaderStyle>
									<ItemStyle  ></ItemStyle>
									<ItemTemplate>
										<%# (string)DataBinder.Eval(Container.DataItem,"MailReadFlag")=="False"?"<img src='../../../Images/mailclose.gif'>":"<img src='../../../Images/mailopen.gif'>" %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:BoundColumn DataField="ClassName" SortExpression="ClassName" HeaderText="所属项目">
									<ItemStyle  ></ItemStyle>
								</asp:BoundColumn>
								<asp:TemplateColumn SortExpression="attsize" HeaderText="大小(Kb)">
									<ItemStyle  ></ItemStyle>
									<ItemTemplate>
										<asp:Label runat="server" Text='<%# (DataBinder.Eval(Container, "DataItem.attsize")).ToString()!=""&&(DataBinder.Eval(Container, "DataItem.attsize")).ToString()!="0"?(DataBinder.Eval(Container, "DataItem.attsize")).ToString()+"":"1" %>'>
										</asp:Label>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn SortExpression="MailSendDate" HeaderText="日期">
									<ItemStyle  ></ItemStyle>
									<ItemTemplate>
										<ItemStyle  ></ItemStyle>
										<asp:Label runat="server" Text='<%# DateTime.Parse(DataBinder.Eval(Container, "DataItem.MailSendDate").ToString()).ToString("yyyy-MM-dd") %>'></asp:Label>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle Font-Size="12px" BorderColor="#E0E0E0" BorderStyle="Dotted" HorizontalAlign="Right" BackColor="#E8F4FF" Mode="NumericPages"></PagerStyle></asp:datagrid>
        </div>
  </div>
  </form>
</div>
</body>
</html>